/*
 * @Copyright: Copyright (C) AMCAX, All rights reserved.
 * @Author: 殷建峰
 * @Date: 2025-02-05 14:09:37
 * @LastEditTime: 2025-02-25 15:39:49
 * @LastEditors: 殷建峰
 * @Description:
 */
import styles from './styles.module.scss';
import { IToolLayout } from '../types';
import { Divider, Flex } from 'antd';
interface IProps {
  cmdLayouts: IToolLayout[][];
}
export default function ToolBar({ cmdLayouts }: IProps) {
  return (
    <div className={styles.toolBar}>
      {cmdLayouts.map((item, index) => (
        <Flex
          key={index}
          className='my-2'>
          {item.map((cmdLayout) => (
            <Flex
              key={cmdLayout.id}
              style={{ width: cmdLayout.width, minWidth: 'max-content' }}
              align={'center'}>
              <Divider
                type='vertical'
                className='h-[70%]'
                dashed
              />
              <div
                key={cmdLayout.id}
                className='flex-1'>
                {cmdLayout.layout}
              </div>
            </Flex>
          ))}
        </Flex>
      ))}
    </div>
  );
}
